/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package be.ac.ua.pats.thesisrobotica.robot.main;

import lejos.nxt.SensorPort;
import lejos.nxt.SensorPortListener;
import lejos.nxt.comm.RConsole;

/**
 *
 * @author Admin
 */
public class ListenerTest {

    public static void main(String[] args) throws InterruptedException {
            RConsole.openUSB(20000);
            SensorPort.S1.addSensorPortListener(new SensorPortListener() {

            public void stateChanged(SensorPort sp, int i, int i1) {
                RConsole.println("Touchsensor value changed: "+i1);
            }
        });

        Thread.sleep(5000);

        SensorPort.S4.addSensorPortListener(new SensorPortListener() {

            public void stateChanged(SensorPort sp, int i, int i1) {
               RConsole.println("Ultrasonic sensor value changed: "+i1);
            }

        });

       Thread.sleep(10000);

              RConsole.close();
    }
}
